/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.Amount;
import gatperdut.chato.model.Chato.Item.ItemPackage;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Amount</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.AmountImpl#getCurrent <em>Current</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.AmountImpl#getMax <em>Max</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class AmountImpl extends CDOObjectImpl implements Amount {
	/**
     * The default value of the '{@link #getCurrent() <em>Current</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getCurrent()
     * @generated
     * @ordered
     */
	protected static final int CURRENT_EDEFAULT = 0;

	/**
     * The default value of the '{@link #getMax() <em>Max</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getMax()
     * @generated
     * @ordered
     */
	protected static final int MAX_EDEFAULT = 0;

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected AmountImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return ItemPackage.Literals.AMOUNT;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected int eStaticFeatureCount() {
        return 0;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public int getCurrent() {
        return (Integer)eDynamicGet(ItemPackage.AMOUNT__CURRENT, ItemPackage.Literals.AMOUNT__CURRENT, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setCurrent(int newCurrent) {
        eDynamicSet(ItemPackage.AMOUNT__CURRENT, ItemPackage.Literals.AMOUNT__CURRENT, newCurrent);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public int getMax() {
        return (Integer)eDynamicGet(ItemPackage.AMOUNT__MAX, ItemPackage.Literals.AMOUNT__MAX, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setMax(int newMax) {
        eDynamicSet(ItemPackage.AMOUNT__MAX, ItemPackage.Literals.AMOUNT__MAX, newMax);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.AMOUNT__CURRENT:
                return getCurrent();
            case ItemPackage.AMOUNT__MAX:
                return getMax();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.AMOUNT__CURRENT:
                setCurrent((Integer)newValue);
                return;
            case ItemPackage.AMOUNT__MAX:
                setMax((Integer)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.AMOUNT__CURRENT:
                setCurrent(CURRENT_EDEFAULT);
                return;
            case ItemPackage.AMOUNT__MAX:
                setMax(MAX_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.AMOUNT__CURRENT:
                return getCurrent() != CURRENT_EDEFAULT;
            case ItemPackage.AMOUNT__MAX:
                return getMax() != MAX_EDEFAULT;
        }
        return super.eIsSet(featureID);
    }

} //AmountImpl
